package com.sicheng.datastruct.sparsearr;

public class SparseArray {
    public static void main(String[] args) {

        int[][] chess = new int[11][11];
        chess[1][2]=1;
        chess[2][3]=2;
        print(chess);

        //二维数组转换为稀疏数组
        //1遍历原数组得到不为0的元素个数


    }

    public static void print(int[][] chess){
        for (int[] ints : chess) {
            for (int anInt : ints) {
                System.out.print(anInt+" ");
            }
            System.out.println();
        }
    }

}
